#!/bin/bash
#
# Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# try to get primary screen resolution, for example, extract 1440x900
# from "LVDS1 connected primary 1440x900+0+0 (normal left inverted
# right x axis y axis)"
# resolution=$(xrandr | grep primary | grep -oE '[0-9]+x[0-9]+')

# # if failed, try to get the master screen resolution
# if [ -z "${resolution}" ]; then
#   resolution=$(xrandr | grep Screen\ 0 | awk -F, '{print $2}' | \
#                sed -e 's/current//g' -e 's/ //g')
# fi

# # if failed again, fallback to 1024x768
# if [ -z "${resolution}" ]; then
#   resolution="1024x768"
# fi

# installer_set "DI_CUR_RESOLUTION" "${resolution}"

# 暂时直接写入该分辨率，已适配新的grub主题
installer_set "DI_CUR_RESOLUTION" "1024x768"

return 0
